package com.xiaozhen.modbus.service;

import com.xiaozhen.common.core.domain.device.Device;
import com.xiaozhen.common.core.domain.driver.ParseModbusAttribute;
import com.xiaozhen.common.core.domain.driver.ParseModbusDriver;

/**
 * HISTORY
 *
 * @author zhenweisheng
 * @date 2021/11/15 14:49
 * @description:
 */
public interface ModbusService {

    /**
     * 读取
     *
     * @param device
     * @param driver
     * @param attribute
     * @return
     * @throws Exception
     */
    String read(Device device, ParseModbusDriver driver, ParseModbusAttribute attribute) throws Exception;

    /**
     * 写入
     *
     * @param device
     * @param driver
     * @param attribute
     * @param value
     * @return
     * @throws Exception
     */
    Boolean write(Device device, ParseModbusDriver driver, ParseModbusAttribute attribute, String value) throws Exception;
}
